package nan.nanfang.test09;

import java.util.Random;

public class Xiaotou extends RenChouXian{
    public void toudao(Gateprogram gateprogram){
        if (gateprogram instanceof FangDaoMen){
            System.out.println("防盗门发出了响铃");
            return;
        }
        int count = new Random().nextInt(6);
        if (count >= 3 ){
            System.out.println("防盗门发出了响声");
            System.out.println("偷盗失败");
            return;
        }
        super.KaiMen(gateprogram);
//        super.GuanMen(gateprogram);
        System.out.println("偷盗成功");
    }
}
